-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locate InternalIP and ExternalIP by vSphere Network name #271
Conversation
Welcome @zuzzas! |
Hi @zuzzas. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
Thanks! Going to fix tests today. |
Some tests have failed, but these are not related to my changes. |
We need to carefully think about if those new fields in the config belong in What do you think @andrewsykim ? |
My initial question is if we should accept network names or their subnets 🤔 need to noodle on that one too |
If we do "VM Network" names (this should be done per VC and not in [global] also), there would be a strict requirement that each NIC must have only a single ipv4 and/or ipv6 bound to it. |
So if NICs can be bound to more than 1 address it sounds like it should be based on subnet? @zuzzas thoughts? |
Also, if there is only a single ipv4 or ipv6 address on the VM, we shouldn't force/require setting those new config options. It should just work. We should also move these new config options out of pkg/common because that package is shared with CSI and these new fields have no meaning to CSI. The new config options should be placed in pkg/cloudprovider/vsphere |
Fixes #266 |
I'll refactor the config and contribute to the discussion about network names vs subnet CIDR tomorrow. |
0ccc0c3
to
d746f87
Compare
I've started to muse about pros and cons of L2 vs L3 matching (network names vs IPs), but the point was moot, since a user might find both approaches desirable, so I've just coded both variants. I've also created a separate CPI-specific config, but dependency injection of it left a lot to be desired. The tests were not updated, I'll do them once you, guys, approve of these changes. |
My thinking here is that because Kubernetes node addresses are strictly L3, the config we expose to users should also strictly be L3. I'm interested in the use-cases for L2 though -- is it possible to specify a network name that gives me more than 2 addresses for a node? If so what should be the expected behavior? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update on this PR! I think we might be just about there.
In regards to the go tests failing... I have a PR to fix one and @codenrhoden is taking a look at the other one. Tracking both in this PR #273 |
/retest This should at least pass the CI now we have merged the two PRs to fix the unit and integration tests. Still need to resolve the overall discussion with the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments, PR is looking great otherwise
/lgtm Can you squash commits and use a more descriptive message please? |
You can now specify (in the new CPIConfig) "internal-network-subnet-cidr" and/or "external-network-subnet-cidr". These are used to determine which IP (the first one of each type is considered) address to map to InternalIP or ExternalIP when setting Node's object's "status.addresses" field. Signed-off-by: Andrey Klimentyev <andrey.klimentyev@flant.com>
dba3c65
to
f919c7d
Compare
@andrewsykim |
/lgtm Leaving final approval to @dvonthenen |
Thanks @zuzzas ! |
Seriously! Awesome contribution @zuzzas! /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dvonthenen The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Currently, vsphere CCM will iterate over physical vNICs and setup first IP address on each as both InternalIP and . This behavior is undesirable, if we are aware of vSphere Network names.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged):fixes #270